package com.xcm.dao;

import com.xcm.model.RoleAuthority;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Set;

/**
 * 角色权限
 *
 * @author linqiang
 * @date 2018-04-13 9:15
 */
public interface RoleAuthorityMapper {
    /**
     * 统计角色权限
     *
     * @param authorityId 权限id
     * @return
     */
    int countRoleAuthority(@Param("authorityId") Integer authorityId, @Param("roleId") Integer roleId);

    /**
     * 批量删除角色权限关联
     *
     * @param authorityIdSet 权限id集合
     * @return
     */
    int batchDeleteByAuthorityIds(@Param("authorityIdSet") Set<Integer> authorityIdSet);

    /**
     * 给角色绑定权限
     *
     * @param roleAuthorityList
     */
    void batchSave(@Param("roleAuthorityList") List<RoleAuthority> roleAuthorityList);

    /**
     * 删除角色权限关联
     *
     * @param roleId
     * @param authorityId
     */
    void deleteRoleAuthority(@Param("roleId") Integer roleId, @Param("authorityId") Integer authorityId);
}
